home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19980424-19980901 / 000284_news@newsmaster….columbia.edu _Thu Jul 16 12:33:57 1998.msg < prev    next >
Internet Message Format  |  1998-08-31  |  4KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA25626
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 16 Jul 1998 12:33:56 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA18726
  7.     for kermit.misc@watsun; Thu, 16 Jul 1998 12:33:56 -0400 (EDT)
  8. Path: news.columbia.edu!sol.ctr.columbia.edu!paralynx!news.mindlink.net!paralynx-2!paralynx!paralynx-4!van-bc!nntp.portal.ca!nntp.cs.ubc.ca!news.Stanford.EDU!su-news-feed2.bbnplanet.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.wli.net!news.he.net!Supernews60!supernews.com!peerfeed.ncal.verio.net!bug.rahul.net!samba.rahul.net!rahul.net!a2i!dold.a2i!dold
  9. From: dold@88.usenet.us.com
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Key Mapping
  12. Date: 16 Jul 1998 16:30:26 GMT
  13. Organization: a2i network
  14. Lines: 54
  15. Message-ID: <6ol9r2$2nf$1@samba.rahul.net>
  16. References: <6okifb$ijr$1@nclient1-gui.server.virgin.net>
  17. Reply-To: dold@network.rahul.net
  18. NNTP-Posting-Host: waltz.rahul.net
  19. NNTP-Posting-User: dold
  20. X-Newsreader: TIN [version 1.2 PL2]
  21. X-Comment: Encoded From: line allows replies that preserve original subject
  22. Xref: news.columbia.edu comp.protocols.kermit.misc:8986
  23.  
  24. Fergus Strachan (fergus.strachan@virgin.net) wrote:
  25. : Small problem with my arrow keys...
  26.  
  27. : Got direct serial connection to a UNIX box using VT320/220 and everything's
  28. : almost fine, except some of the keys...
  29. : I tried the standard key 'numbers' at the back of the book to map to the
  30. : \KUpArr etc. but to no avail - when I use the arrow keys it asks me if I
  31. : want to exit the unix program I'm running.
  32.  
  33. That is an indication that the program is seeing the ESC character at the
  34. start of the string, and recognizing it as an escape, without waiting to
  35. see if the next character is part of a control sequence.
  36.  
  37. I went through some major rewrite of the curses library for SVR3 in this
  38. area when I was in kernel support.  Most Unix boxes have a hard time with
  39. the timing, especially if any buffering is involved, like TCP, or
  40. high-speed modems, or even buffered UARTs in the host box, that might
  41. "split" packets between the ESC and the [
  42.  
  43. This is aside from the clues that Frank gives in another reply, but it
  44. could be that your Unix box is the problem.  Does it happen at different
  45. baud rates?  I vaguely recall that there were some speed-based parameters
  46. in the code.
  47.  
  48. Go to a Unix shell prompt.
  49.     od -c <ENTER>
  50.     <RIGHT ARROW> <ENTER>
  51.     ctrl-d
  52.  
  53. 0000000  033   [   C  \r
  54.  
  55. In my case, this indicates that a right arrow is producing an ESC, followed
  56. by a left bracket and C.
  57.  
  58. infocmp     (some lines deleted)
  59. AT386|at386|386AT|386at|at/386 console,
  60.     kclr=\E[2J, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
  61.     kcuu1=\E[A, kdch1=\E[P, kend=\E[Y, kf1=\EOP,
  62.  
  63. infocmp tells me what Unix is expecting from my terminal, which is defined
  64. as an AT386.  \E[C is for "key-cursor-forward-mode1", you can see A,B,C,D
  65. described as up,down,forward,back.
  66.  
  67. So my arrow keys match what Unix expects.  If this wasn't true, there would
  68. be work to do.  If it is true, and the keys don't work, especially if they
  69. work intermittently, the curses library is probably at fault.
  70.  
  71. Function keys have the same problem, a sequence starting with an ESC, which
  72. is used by a lot of programs for escaping from a particular screen.
  73. In the short sample above, kf1 is function key 1.
  74. -- 
  75. ---
  76. Clarence A Dold - dold@network.rahul.net
  77.                 - Pope Valley & Napa CA.